﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
using UDS.Components;
using UDS.Entity;

namespace UDS.SubModule.UnitiveDocument.DocumentFlowPages
{
    /// <summary>
    /// ManageStyle 的摘要说明。
    /// </summary>
    public partial class ManageStylePage : Page
    {
        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Bangding();
            }

            base.OnLoad(e);
        }

        public void MyDataGrid_Delete(object sender, DataGridCommandEventArgs e)
        {
            string StyleID = dgStyleList.DataKeys[e.Item.ItemIndex].ToString();
            FlowStyle.DeleteStyle(Int32.Parse(StyleID));
            Bangding();
        }

        #region 绑定DBGRID

        private void Bangding()
        {
            dgStyleList.DataSource = FlowStyle.GetAllFlowStyles();
            dgStyleList.DataBind();
        }

        #endregion

        #region 翻页事件

        public void DataGrid_PageChanged(object sender, DataGridPageChangedEventArgs e)
        {
            dgStyleList.CurrentPageIndex = e.NewPageIndex;
            Bangding();
        }

        #endregion
    }
}